
<html>
<head>
    <meta charset="UTF-8">
    <!-- Latest compiled and minified CSS -->

</head>


<body>
   <button onclick="share()">js调用native</button><br>


    <script>

        function share(){
            //调用java的share方法
            console.log("js中getImage方法调用了");
             window.WebViewJavascriptBridge.callHandler(
                'getImage'

            );
        }

        function showName(){
             //call native method
            window.WebViewJavascriptBridge.callHandler(
                'getUserName'
                ,'hello'
                , function(responseData) {
                    document.getElementById("text1").value = responseData
                }
            );
        }
function setupWebViewJavascriptBridge(callback) {
	if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
	if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
	window.WVJBCallbacks = [callback];
	var WVJBIframe = document.createElement('iframe');
	WVJBIframe.style.display = 'none';
	WVJBIframe.src = 'https://__bridge_loaded__';
	document.documentElement.appendChild(WVJBIframe);
	setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
}
    setupWebViewJavascriptBridge(function(bridge) {
		bridge. ('setFile', function(data, responseCallback) {
                console.log("native掉js传过来的参数："+data);
		})

	})

    </script>
   <div id="helloweb"  >
   </div>


</body>
</html>